<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            /* 3D转换配合透视才能生效-perspective  透视需要加在需要3D转换的元素的父盒子上*/
            perspective: 200px;
        }

        .box {
            position: relative;
            height: 200px;
            width: 200px;
            margin: 40px auto;
            transform-style: preserve-3d;
            transition: all 1s;
        }

        .back,
        .front {
            position: absolute;
            top: 0;
            right: 0;
            height: 200px;
            width: 200px;
            color: #fff;
            line-height: 200px;
            text-align: center;
            border-radius: 50%;
        }

        .front {
            /* z-index: 1; */
            transform: translateZ(1px);
            background-color: blueviolet;
        }

        .back {
            background-color: pink;
            /* 让两个盒子背靠背 */
            transform: rotateY(180deg);
        }

        .box:hover {
            transform: rotateY(180deg);
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="front">黑马程序员</div>
        <div class="back">pink老师在这里等你</div>
    </div>
</body>

</html>